package cn.wsw.hrm.client;


import cn.wsw.hrm.util.AjaxResult;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

//@FeignClient(value = "HRM-REDIS",configuration = FeignClientsConfiguration.class,
//        fallbackFactory = FastdfsClientFallbackFactory.class )//服务提供者的名称
@FeignClient(value = "HRM-FASTDFS",configuration = FeignMultipartSupportConfig.class,
                                    fallbackFactory = FastdfsClientFallbackFactory.class
)
@RequestMapping("/fast")
public interface FastdfsClient {
    @PostMapping(produces = {MediaType.APPLICATION_JSON_UTF8_VALUE}
            , consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    AjaxResult upload(@RequestPart(value = "file", required = true) MultipartFile file);


    // /goup1/xxxxx/yyyy
    @GetMapping
    Response download(@RequestParam(value = "filePath", required = true) String filePath);
}
